#!/bin/bash

# Installation/Removal path
################################################################################################
resource_path=/usr/local/src/bash-masters;
################################################################################################

source ./core.sh || exit;

.root() {
    [[ $EUID -eq 0 ]] || {
        echo "Usage of this package requires administrative rights.";
        return 1;
    }
}

bash.report "Checking for super user permission" .root || exit;

[[ -d /usr/src/bash-masters ]] && {
    bash.report "Removing legacy files" rm -r /usr/src/bash-masters
}

target="$(pwd)/install/${1:-install}"; shift;

[[ -e "$target" ]] || {
    bash.io.write -c red -b "$target is not a valid installation module" >&2;
    exit 1;
}

source $target "$@" 

exit
